﻿namespace TimeSpan.Views.Dialogs;

public partial class NewRecordWindow : IEditor<SpanTaskOption> {

    public SpanTaskOption? ObjectToEdit { get; set; }

    public NewRecordWindowViewModel ViewModel { get; } = new();

    public NewRecordWindow() {
        InitializeComponent();
    }

    private void CloseButton_Click(object sender, System.Windows.RoutedEventArgs e) {
        DialogResult = false;
    }

    private void Slice_Click(object sender, System.Windows.RoutedEventArgs e) {
        ObjectToEdit = ViewModel.Slice(SpanSlider.Value);
        DialogResult = true;
    }

}